package com.nolon.flange.viewmodel

import android.app.Application
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

class FlangeViewModelFactory(
    private val application: Application,
    private val projectId:Int
) : ViewModelProvider.Factory {
    @Suppress("UNCHECKED_CAST")
    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        if (modelClass.isAssignableFrom(FlangeViewModel::class.java)) {
            return FlangeViewModel(application,projectId) as T
        }
        throw IllegalArgumentException("Unknown ViewModel class")
    }
}